Skip to content

Drop timeout on sync.#33

Open
wutje wants to merge 1 commit intosq5bpf:mainfrom
wutje:fix-remove-out-of-sync-timeout
Open

Drop timeout on sync.#33
wutje wants to merge 1 commit intosq5bpf:mainfrom
wutje:fix-remove-out-of-sync-timeout

Conversation

@wutje
Copy link
Copy Markdown
Contributor

@wutje wutje commented Jul 21, 2025

When out of sync all bytes must be drained at once in order to be able to reach sync again. This strategy works because the radio will repeatedly send the bootmessage. We do not need to save bytes and try to sync up based on bytes, just drop all received bytes and wait for the radio to send a new bootmessage.

If we wait 10 seconds (or any time longer then the boot message repeat time) we will read garbage from the previous package, discard those and the rest of the message and we will never reach sync.

When out of sync all bytes must be drained at once in order to be able to reach sync again.
This strategy works because the radio will repeatedly send the bootmessage.
We do not need to save bytes and try to sync up based on bytes, just drop all received bytes and wait for the radio to send a new bootmessage.

If we wait 10 seconds (or any time longer then the boot message repeat time) we will read garbage from the previous package, discard those and the rest of the message and we will never reach sync.
@wutje
Copy link
Copy Markdown
Contributor Author

wutje commented Jul 21, 2025

Ah after some more reading I think this also solves the problems in #22. My original implementation was like this but then commit 3eb6e14 changed the timeout from 0 to 10000.
I did not notice until today because I just used my own compiled version and did not do a lot of development anyway. When I picked up this weekend I noticed this behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant